[IA64] Add xen boot option "dom0_vcpus_pin"
authorawilliam@xenbuild.aw <awilliam@xenbuild.aw>
Tue, 12 Sep 2006 17:29:02 +0000 (11:29 -0600)
committerawilliam@xenbuild.aw <awilliam@xenbuild.aw>
Tue, 12 Sep 2006 17:29:02 +0000 (11:29 -0600)
This patch adds the xen boot option to pin Domain-0 VCPUs.

Signed-off-by: Kouya SHIMURA <kouya@jp.fujitsu.com>
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
xen/arch/ia64/xen/domain.c
xen/arch/ia64/xen/xensetup.c

index 2073fd52c79bdae7e342127e2221ccbddd0c84de..17ca6ff40e4c8ca3c5a43e02b996b2e728925b0e 100644 (file)
@@ -54,6 +54,7 @@ unsigned long dom0_align = 64*1024*1024;
 static unsigned int dom0_max_vcpus = 1;
 integer_param("dom0_max_vcpus", dom0_max_vcpus); 
 
+extern int opt_dom0_vcpus_pin;
 extern unsigned long running_on_sim;
 
 extern char dom0_command_line[];
@@ -1020,9 +1021,12 @@ int construct_dom0(struct domain *d,
            dom0_max_vcpus = MAX_VIRT_CPUS;
        
        printf ("Dom0 max_vcpus=%d\n", dom0_max_vcpus);
-       for ( i = 1; i < dom0_max_vcpus; i++ )
+       for ( i = 1; i < dom0_max_vcpus; i++ ) {
            if (alloc_vcpu(d, i, i) == NULL)
                printf ("Cannot allocate dom0 vcpu %d\n", i);
+           else if (opt_dom0_vcpus_pin)
+               d->vcpu[i]->cpu_affinity = cpumask_of_cpu(i);
+       }
 
        /* Copy the OS image. */
        loaddomainelfimage(d,image_start);
index 8c2140972eb9599f91e82d84883b73ecb1cebb1f..12c6850aa760ca4fef1ba9b2f7cd00f8f1ef1f5c 100644 (file)
@@ -49,6 +49,10 @@ extern void mem_init(void);
 extern void init_IRQ(void);
 extern void trap_init(void);
 
+/* opt_dom0_vcpus_pin: If true, dom0 VCPUs are pinned. */
+unsigned int opt_dom0_vcpus_pin = 0;
+boolean_param("dom0_vcpus_pin", opt_dom0_vcpus_pin);
+
 /* opt_nosmp: If true, secondary processors are ignored. */
 static int opt_nosmp = 0;
 boolean_param("nosmp", opt_nosmp);
@@ -517,6 +521,10 @@ printk("num_online_cpus=%d, max_cpus=%d\n",num_online_cpus(),max_cpus);
                        0) != 0)
         panic("Could not set up DOM0 guest OS\n");
 
+    /* PIN domain0 VCPU 0 on CPU 0. */
+    if (opt_dom0_vcpus_pin)
+        dom0->vcpu[0]->cpu_affinity = cpumask_of_cpu(0);
+
     if (!running_on_sim)  // slow on ski and pages are pre-initialized to zero
        scrub_heap_pages();